package com.edu.dk.security;

import java.io.IOException;

import javax.servlet.ServletException;

public interface Filter extends WebContextFactory<WebContext> {
	String DK_FILTER = "dk-filter";
	String DK_WRAPPER_FILTER = "dk-wrapper-filter";

	/**
	 * 
	 * 前置操作
	 * 
	 * @param context
	 * 
	 * @throws ServletException
	 * @throws IOException
	 */
	void preProcess(WebContext context) throws ServletException, IOException;

	/**
	 * 后置操作
	 *
	 * @param context
	 * @throws ServletException
	 * @throws IOException
	 */
	void postProcess(WebContext context) throws ServletException, IOException;

	/**
	 * 是否匹配
	 * 
	 * @param url
	 * @return
	 * 
	 */
	boolean isMatch(String url);

	void setFilterName(String filterName);

	String getFilterName();

}
